#pragma once

#include "platform/vk/vk_utils.h"

namespace vkrender
{
    class VulkanWindow
    {
    private:
        GLFWwindow* window;
        uint32_t width;
        uint32_t height;
        std::string windowName;
        bool framebufferResized = false;

    public:
        VulkanWindow(uint32_t w, uint32_t h, const std::string& name);
        ~VulkanWindow();

        bool shouldClose() const { return glfwWindowShouldClose(window); }
        VkExtent2D getExtent();
        void createWindowSurface(VkInstance instance, VkSurfaceKHR* surface);

        bool windowResized() const { return framebufferResized; }
        void resetResizedFlag() { framebufferResized = false; }

    private:
        static void framebuffer_resize_callback(GLFWwindow* window, int width, int height);
        static void mouse_move_callback(GLFWwindow* window, double xpos, double ypos);
        static void mouse_button_callback(GLFWwindow* window, int button, int action, int mods);
        static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods);
        void init();

    };
}
